package com.example.rotateimageview

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.LayoutInflater
import android.widget.FrameLayout
import android.widget.TextView
import kotlinx.android.synthetic.main.activity_slide_menu_layout.*

class SlideMenuLayoutActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_slide_menu_layout)

        slide_layout.apply {

            val menuView=LayoutInflater.from(this@SlideMenuLayoutActivity).inflate(R.layout.layout_menu,null,false)
            menuView.findViewById<TextView>(R.id.tv_apple).setOnClickListener {
                closeMenuView()
                setMainViewContent((it as TextView).text.toString())
            }

            setMenuView(menuView,layoutParams = FrameLayout.LayoutParams(500,FrameLayout.LayoutParams.MATCH_PARENT))

            val mainView=LayoutInflater.from(this@SlideMenuLayoutActivity).inflate(R.layout.slide_main_view,null,false)
            setMainView(mainView,layoutParams = FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,FrameLayout.LayoutParams.MATCH_PARENT))
        }
    }
}